/******************************************************************************
Desc:
  A simple tetris game for DOS. Compiled by Turbo C 2.0.
	compile command: tcc tetris graphics.lib
  This program is only a sample, anyone can distribute it in anyway. :-)

Auth:
  Kang Kai (siaview@163.com) 2002-09-03

******************************************************************************/

/*   Tetris.h --- head file that contains some marcos and types.   */

#ifndef __TETRIS_H__
#define __TETRIS_H__

#define BRICK_SIZE         20

#define BLOCK_PER_ROW      10
#define ROW_COUNT          20

/* Position of main pane */
#define PANE_LEFT          100
#define PANE_TOP           50
#define PANE_RIGHT         PANE_LEFT + (BRICK_SIZE * BLOCK_PER_ROW)
#define PANE_BOTTOM        PANE_TOP + (BRICK_SIZE * ROW_COUNT)

/* Position of preview pane */
#define PREVIEW_PANE_LEFT  PANE_RIGHT + 40
#define PREVIEW_PANE_TOP   PANE_TOP + 30
#define PREVIEW_PANE_RIGHT PREVIEW_PANE_LEFT + (BRICK_SIZE * 5)
#define PREVIEW_PANE_BOTTOM PREVIEW_PANE_TOP + (BRICK_SIZE * 3)

#define CELL_EMPTY         -1

#define DRAW_BLOCK_NORMAL  0
#define DRAW_BLOCK_ERASE   1

typedef struct _XY_POS
{
    short x;
    short y;
} XY_POS;

typedef struct _CUR_BLOCK_SHAPE
{
    short nBlockType; /* 0 -- 6, seven kinds */
	short rotate_status; /* 0 --- 3, maybe less */
    XY_POS Blocks[4];
} CUR_BLOCK_SHAPE;

#endif /* __TETRIS_H__ */
